package com.flying.admin.service;

import com.flying.common.annotation.DaoCreate;
import com.flying.common.annotation.DaoQuery;
import com.flying.common.annotation.DaoRemove;
import com.flying.common.annotation.DaoUpdate;
import com.flying.framework.annotation.MethodInfo;
import com.flying.framework.annotation.Param;
import com.flying.framework.annotation.Service;
import com.flying.framework.data.Data;
import com.flying.framework.service.AbstractService;

@Service(value="EventType", desc="事件类型")
public class EventType extends AbstractService{
	public final static String TABLE_NAME = "sys_event_type";
	
	public enum Field {
		
		type_id        ("type_id",           "int",	"类型ID"),
		name           ("name",              "String",	"类型名称"),
		remark         ("remark",            "String",	"说明");
		
		public final String fieldName;
		public final String fieldType;
		public final String fieldComment;
	
		Field(String name, String dataType, String comment) {
			this.fieldName 		= name;
			this.fieldType		= dataType;
			this.fieldComment	= comment;
		}
	}
        
	@MethodInfo("创建事件类型")
	@DaoCreate(entity="sys_event_type")
	public Data create(
		
			@Param(value="type_id",           required=true,	desc="类型ID") int type_id,
			@Param(value="name",              required=false,	desc="类型名称") String name,
			@Param(value="remark",            required=false,	desc="说明") String remark
		
		) throws Exception {
		
		return null;
	}

	@MethodInfo("修改事件类型")
	@DaoUpdate(entity="sys_event_type")
	public Data update(
		
			@Param(value="type_id",           required=false,	desc="类型ID") int type_id,
			@Param(value="name",              required=false,	desc="类型名称") String name,
			@Param(value="remark",            required=false,	desc="说明") String remark,
			@Param(value="fields", required=false, desc="更新字段", tag="fields") String[] fields
			
		) throws Exception {
		
		return null;
	}

	@MethodInfo("删除事件类型")
	@DaoRemove(entity="sys_event_type")
	public Data remove(
		
			@Param(value="type_id",           required=true,	desc="类型ID") int type_id
		
		) throws Exception {
		
		return null;
	}

	@MethodInfo("查询所有事件类型")
	@DaoQuery(entity="sys_event_type")
	public Data findAll() throws Exception {
		return null;
	}

	@MethodInfo("根据主键查询事件类型")
	@DaoQuery(entity="sys_event_type", single=true)
	public Data findById(
		
			@Param(value="type_id",           required=true,	desc="类型ID") int type_id
		
		) throws Exception {
		return null;
	}

}